<?php

/**
 * page actions.
 *
 * @package    khas
 * @subpackage page
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 3335 2007-01-23 16:19:56Z fabien $
 */
class matchActions extends sfActions
{
    public function preExecute()
    {
        ProjectConfiguration::getApplicationConfiguration('front', 'prod', false)->loadHelpers('Url');
    }
    
    public function executeShow(sfWebRequest $request)
    {
        $this->seasonId = $seasonId = $request->getParameter('seasonId');
        $this->getUser()->setAttribute('activeSeasonId', $seasonId);
        switch ($seasonId) {
        	case 2: $this->getUser()->setAttribute('mainmenu', 'tlg'); break;
        	case 3: $this->getUser()->setAttribute('mainmenu', 'tlg'); break;
        	default:break;
        }
        
        $match = Doctrine::getTable('BbMatch')->find($request->getParameter('id'));
        $this->forward404Unless($match);
        
        $this->match = $match;
        
        $breadcrumbs = array();
        $breadcrumbs[] = '<span>&raquo;</span><a href="'.url_for('schedule/index?seasonId='.$seasonId).'">Тоглолтууд</a>';
        $breadcrumbs[] = '<span>&raquo;</span><a href="'.url_for('match/show?id='.$match->getId().'&seasonId='.$seasonId).'">'.$match.'</a>';
        $this->getResponse()->setSlot('breadcrumbs', $breadcrumbs);
        
        
    }
    
    public function executeIndex(sfWebRequest $request)
    {
      
    }

}